package bocchi.card;

import bocchi.BocchiCore;
import bocchi.base.BaseCustomCard;
import bocchi.general.Util;
import bocchi.power.ResolvePower;
import bocchi.stance.HeroicStance;
import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.actions.watcher.ChangeStanceAction;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import com.megacrit.cardcrawl.powers.AbstractPower;

public class CheerUp extends BaseCustomCard {
    private static final String RAW_ID = CheerUp.class.getSimpleName();
	public static final String GAME_ID = BocchiCore.getGameID(RAW_ID);

    public CheerUp() {
        super(RAW_ID);
    }

    @Override
    public void use(AbstractPlayer player, AbstractMonster monster) {
        Util.applyPower(player, player, new ResolvePower(player, 2));
        addToBot(new AbstractGameAction() {
            @Override
            public void update() {
                AbstractPower resolve = player.getPower(ResolvePower.GAME_ID);
                if (resolve != null && resolve.amount >= magicNumber) {
                    addToTop(new ChangeStanceAction(new HeroicStance()));
                }
                isDone = true;
            }
        });
    }
}
